package com.srcptit.java.tranning.hoangdd.btvn1;

import java.util.Scanner;

public class Bai1Muc2 {

    public static void nhap(int n){
    Scanner sc = new Scanner(System.in);
    float bp;
    float []a = new float [100];
    for(int i=0; i<n; i++){
        System.out.print("a[" +i+ "] = ");
        a[i] = sc.nextFloat();
    }
    for(int i=n-1 ; i>=0; i--)
        for(int j=0; j<i; j++)
            if(a[j] > a[j+1]){
                bp = a[j];
                a[j] = a[j+1];
                a[j+1] = bp;
            }
    for(int i=0; i<n; i++)
        System.out.println(a[i]);
                
}
    
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    System.out.print("Nhap so luong phan tu trong mang n = ");
    int n = sc.nextInt();
    nhap(n);
    }
}